    	     <?

	     if(!$files):
	          if(file_exists(yii::getPathOfAlias('webroot').'/themes/'. Yii::app()->theme->name.'/images/foto_zagl'.$width.'x'.$height.'.png')) 
	          	$img = '<img src="' .Yii::app()->request->baseUrl.'/themes/'. Yii::app()->theme->name.'/images/foto_zagl'.$width.'x'.$height.'.png" width="'.$width.'" height="'.$height.'"  alt="No photo" border="0">';
	          else
	     				$img = '<img src="' . Yii::app()->request->baseUrl.'/themes/'. Yii::app()->theme->name.'/images/foto_zagl.png" width="'.$width.'" height="'.$height.'"  alt="No photo" border="0">';
		     if($url)
			      print CHtml::link($img, $url, array('title'=>$file->desc));
	       else
	          echo $img;
	    
	     else:?>

	     <?php

      $file = $files[0];
      if ($percent) $widthImg = $percent;
      else $widthImg = $width;
		  $img = 'http://'.$_SERVER['HTTP_HOST'].Yii::app()->request->baseUrl.
		  ImageHelper::thumb($widthImg,$height,'/' . $file->file,array('method' => $thumbMethod));

		  $img_tag = '<img border=0 src="'.$img .'"  width="'.$width.'"  class="'.$classname.'">';

      if($url)
		      print CHtml::link($img_tag, $url, array('class'=>'firstonly', 'title'=>$file->desc));
      else
          echo $img_tag;
		 ?>

		 <?endif;?>